import { defineMock } from "./base";
import Mock from "mockjs";

const categoryList = (data: any) => {
  return Mock.mock({
    total: 11,
    "rows|10": [
      {
        "id|+1": 1,
        name: "@csentence(2,5)",
      },
    ],
  });
};
export default defineMock([
  {
    url: "/docs/getCategory",
    method: ["GET"],
    body: ({ query, params }) => {
      return {
        code: 1,
        data: categoryList({ ...query }),
        msg: "success",
      };
    },
  },
]);
